<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%String contextPath = request.getContextPath();%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>浏览器插件</title>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/log.css"/>
<script type="text/javascript" src="<%=contextPath%>/scripts/jquery.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/context.jsp"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/card.js"></script>
</head>
<body>
<object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0" height="0"></object> 
<object id="bdLockCard" classid="clsid:130D6F39-2FE2-45FB-92B3-AE73D5B2B4EC"  width="0" height="0"></object>

<table border="1" cellpadding="10" align="center">
	<tr>
		<th colspan="4" align="center">
			<a href="<%=contextPath%>"><h3>7号生态酒店</h3></a>
		</th>
	</tr>
	<tr style="background-color:#eeeeee !important;">
		<th>控件</th>
		<th>状态</th>
		<th>下载</th>
		<th>测试</th>
	</tr>
	<tr>
		<td style="background-color:#eeeeee !important;">读卡器</td>
		<td><span id="cardState"></span></td>
		<td><a href='<%=contextPath%>/others/CarMng.exe'>下载并安装</a></td>
		<td>
			<pre>
	1, 连接好读卡器
	2, 下载并安装读卡器控件
	3, 刷新本页面
	4, 把卡片放在读卡器上
	5, 测试是否可用
	<button id="swingCard">读卡</button>
			</pre>
		</td>
	</tr>
	<tr>
		<td style="background-color:#eeeeee !important;">打印</td>
		<td><span id="printState"></span></td>
		<td><a href='<%=contextPath%>/others/install_lodop.exe'>下载并安装</a></td>
		<td>
			<pre>
	1, 连接好打印机, 准备好打印纸
	2, 下载并安装打印控件
	3, 刷新本页面
	4, 测试是否可以打印
	<button id="print">打印</button>
			</pre>
		</td>
	</tr>
	<tr>
		<th colspan="4">
			<button onclick="history.go(-1);">后退</button>
		</th>
	</tr>
</table>

<script type="text/javascript">
function checkLodop(){
	var oldVersion = $("#LODOP").get(0).Version;
	var	newVerion="4.0.0.2";
	var r = '未安装';
	if (oldVersion == null) {
		r = '未安装';
	} else if (oldVersion < newVerion) {
		r = '需要升级';
	} else {
		r = '已安装';
	}
	$("#printState").text(r);
}     
         
function checkCard(){
	var Hotel = $("#bdLockCard").get(0).Hotel;
	var r = '未安装';
	if (Hotel == null){
		r = '未安装';
	} else {
		r = '已安装';
	}
	$("#cardState").text(r);
}
$(function(){
	if (!$.browser.msie) {
		alert("目前插件不支持IE以外的浏览器.");
		return;
	}
	$("#swingCard").click(function(){
		var serial = Card.readSerial();
		if (serial != null) {
			alert("恭喜你, 读卡器安装成功, 可以使用了");
		} else {
			alert("无法读卡, 请检查前面的步骤, 或者把卡片放在读卡器");
		}
	});
	$("#print").click(function(){
		try {
			var LODOP = $("#LODOP").get(0);
			LODOP.SET_PRINT_PAPER(-13,3,415,343,"七号酒店");
			LODOP.ADD_PRINT_TEXT(47,87,260,39,"7号生态酒店结账凭证");
			LODOP.SET_PRINT_STYLEA(1,"FontSize",15);
			LODOP.SET_PRINT_STYLEA(1,"Bold",1);
			LODOP.PREVIEW();
//			LODOP.PRINT_DESIGN();
		} catch (e){
			alert("打印失败, 请检查前面的步骤");
		}
	});
	checkCard();
	checkLodop();
});
</script>
</body>
</html>